package com.my.structuraltype.proxy.dynamic;

import java.lang.reflect.Proxy;
/**
 * dynamic proxy
* 
* 描述
* @author Hao.Tong
* @version 1.0
* @see 
* @modify
 */
public class Test {
	public static void main(String[] args) {
		People p = new People("jerry", 20);
		TalkHandler handler = new TalkHandler(p);
		
		ITalk talk = (ITalk) Proxy.newProxyInstance(p.getClass().getClassLoader(), p.getClass().getInterfaces(), handler);
		talk.talk("evada");
		
	}
}
